import request from '../utils/request'
import API from './contants'

/**
 * 获取轮播图数据
 * @returns
 */
export const getBanners = () => request({
  url: API.TAB_API + '/1',
  method: 'GET',
  headers: {
    'x-platform': 'pc',
  },
})

/**
 * 获取首页宫格数据
 * @returns
 */
export const getGrids = () => request({
  url: API.TAB_API + '/1',
  method: 'GET',
}).then(data => data.grids)

// /**
//  * 查询首页推荐商品列表
//  * @returns
//  */
// export const getRecommendProducts = (start = 0) => request({
//   url: API.BAOKUAN_API,
//   params: { start },
//   method: 'GET',
// }).then(resData => resData.items)

/**
 * 查询首页推荐商品列表
 * @returns
 */
export const getRecommendProducts = (start = 0) => request({
  url: API.BAOKUAN_API,
  params: { start },
  method: 'GET',
})
